
let port = '5757'
// app 数据库
let mobuzDb
// 小程序 数据库
let mobuzWx
let mobuzUrl

// 开发环境
if (process.env.NODE_ENV !== 'development') {
    // url
    mobuzUrl = 'https://**********.com'
    // koa2 多数据源链接
    mobuzDb = require('knex')({
        client: 'mysql',
        connection: {
            host: '*******',
            port: 5601,
            user: '*******',
            password: '*******',
            database: 'mobuz',
            charset: 'utf8mb4'
        }
    })
    mobuzWx = require('knex')({
        client: 'mysql',
        connection: {
            host: '*******',
            port: 5601,
            user: 'wx',
            password: '*******',
            database: 'wx_mobuz',
            charset: 'utf8mb4'
        }
    })
} else {
    // url
    mobuzUrl = 'https://**********.com'
    // koa2 多数据源链接
    mobuzDb = require('knex')({
        client: 'mysql',
        connection: {
            host: '*******',
            port: 5601,
            user: 'mobuz',
            password: '*******',
            database: 'mobuz',
            charset: 'utf8mb4'
        }
    })
    mobuzWx = require('knex')({
        client: 'mysql',
        connection: {
            host: '*******',
            port: 5601,
            user: 'wx',
            password: '*******',
            database: 'wx_mobuz',
            charset: 'utf8mb4'
        }
    })
}

module.exports = {
    port,
    mobuzDb,
    mobuzWx
}
